package com.base.api.cdr;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.base.api.pms.PmsPublicSqlQuery;
import com.base.utils.TreeUtil;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Component;

import java.text.MessageFormat;
import java.util.*;

/**
 * @author wnhuang
 * @Package com.base.api.cdr
 * @date 2020-12-23 21:45
 */
@Component
public class TestReportInfoDetail extends PmsPublicSqlQuery {
    @Override
    public String splicSql(String sql, Map<String, Object> param) {
        StringBuilder param1 = new StringBuilder();
        if (param != null) {
            param1.append(" and patientID = '" + param.get("patientId") + "'");
            param1.append(" and labsubitemcode = '" + param.get("LabSubItemCode") + "'");
            return MessageFormat.format(sql.replace("'", "''"), param1.toString());
        } else {
            return "select 1 ";
        }
    }

}
